function myconfirm(title, fn) {
	layer.confirm(title, {
		btn : [ '确认', '取消' ]
	}, fn);
}
function closeFrame() {
	var index = parent.layer.getFrameIndex(window.name); // 先得到当前iframe层的索引
	parent.layer.close(index);
}
function openFrame(url, title, area) {
	if (!title)
		title = "编辑";
	if (!area)
		area = [ '340px', '50%' ];
	layer.open({
		type : 2,
		title : title,
		shadeClose : true,
		shade : 0.8,
		area : area,
		content : url
	});
}

function reload(tabid, data, startpage) {
	if (!startpage)
		startpage = 1;
	if (!data)
		data = {};
	layui.table.reload(tabid, {
		page : {
			curr : startpage
		},
		where : data
	}, 'data');
}

function fresh(id) {
	layui.table.reload(id);
}

function render(filter, data) {
	layui.use('form', function() {
		var form = layui.form
		form.val(filter, data);
		form.render();
	});
}
